package cn.dengta.webapp.im.dto;

import java.math.BigDecimal;

import cn.dengta.context.model.Member;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ImIntegralDTO {

	/** 收益方用户ID */
	public Long userId;
	/** 对应积分 */
	public BigDecimal amount;
	/** 消息ID */
	public Long msgId;
	/** 积分过期时间 ，秒 */
	public Long expireTime;
	/** 积分延迟 */
	public Boolean delay;
	/** 亲密度升温记录ID */
	public transient Long ballAwardId;
	public transient MsgConfigDTO.BallAward upgradeAward;

	public ImIntegralDTO() {
	}

	public ImIntegralDTO(Long userId, BigDecimal amount) {
		this.userId = userId;
		this.amount = amount;
	}

	public String getUserId() {
		return Member.encode(userId);
	}

	public void setExpireTime(Long expireTime) {
		if (expireTime != null) {
			this.expireTime = expireTime / 1000;
		} else {
			this.expireTime = null;
		}
	}

}
